package com.dek.seckill.mapper;

import com.dek.seckill.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    User getById(@Param("id") int id);

    @Insert("insert into user (id, name) values (#{id}, #{name})")
    int insert(User user);

    @Select("select * from user where mobile = #{mobile}")
    User getByMobile(String mobile);
}
